//
//  BCFriendVC.m
//  BangcaiBuy
//
//  Created by lsy on 16/7/6.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCFriendVC.h"
#import "BCFriendScrollView.h"
#import "BCFriendModel.h"
@interface BCFriendVC ()
@property (nonatomic, strong)NSMutableArray *models;
@property (nonatomic, retain)BCFriendScrollView *scroll;
@property (nonatomic, copy)void(^enterBlock)();

@end

@implementation BCFriendVC
+(instancetype)friendVC:(NSMutableArray *)models enterBlock:(void(^)())enterBlock
{
    BCFriendVC *newFriendVC = [[BCFriendVC alloc] init] ;
    newFriendVC.models = models;
    newFriendVC.enterBlock = enterBlock;
    return newFriendVC;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self vcPrepare];
    
    
    // Do any additional setup after loading the view.
}

- (void)vcPrepare
{
    self.scroll = [[BCFriendScrollView alloc] initWithFrame:self.view.frame];
    [self.view addSubview:self.scroll];
    [self imageViewsPrepare];
    
}

- (void)imageViewsPrepare
{
    self.scroll.arr = self.models;
    self.scroll.userInteractionEnabled = YES;
    [self.scroll.startButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)click:(UIButton*)tap
{
    if (self.enterBlock!= nil) {
        _enterBlock();
    }
}




@end
